/* $Id$ */

$(function () {
	$('.feedback-message').animate({
		 backgroundColor  : 'white'
		,borderTopColor   : '#eee'
		,borderRightColor : '#eee'
		,borderBottomColor: '#eee'
		,borderLeftColor  : '#eee'
		,color: '#999'
	}, 3000);
	
	$('.focused').focus();
	$("#sortable").sortable({
		axis:'y',
		update : function()
		{
			serial = $("#sortable").sortable('serialize');
			$.ajax({
				type: "POST",
				data: serial,
				dataType: 'json',
				success: function(data) {
					$('#ajax-message').html(data.answer)
							.css({'display':'inline'})
							.oneTime("2s", function() {
								$('#ajax-message').css({'display':'none'});
							});
				},
				error: function() {
					$('#ajax-message').html('Error');
				}
			});
		}
	});	
});

